import service from '../utils/service';

// process.env.NODE_ENV
const baseUrl = window.config_url.baseUrl;

const get = opt => {
	const url = baseUrl + opt.url;
	Object.assign(opt, {
		url: url,
		method: 'get'
	});
	return service({
		...opt,
	});
};

const post = opt => {
	const url = baseUrl + opt.url;
	Object.assign(opt, {
		url: url,
		method: 'post'
	});
	return service({
		...opt,
	});
};


export default {
	get,
	post
};
